﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SmartEP.DTO;
using SmartEP.DataService ;

namespace SmartEP.Presenter
{
    public class UserPresenter
    {
        private IUser _user;
        private UserService _services;

        public UserPresenter(IUser user)
        {
            this._user = user;
            this._services = new UserService();
        }

        public void AuthenticateUser()
        {
            User user = new User(_user.UserName, _user.Password);
            _user.AuthenticateUser(_services.AuthenticateUser(user));           
        }

        public void WriteLoginXML(string FileName)
        {
            User user = new User(_user.UserName, _user.Password);
            _services.WriteLoginXML(FileName, user);
        }

        public System.Collections.ArrayList  ReadLoginXML(string FileName)
        {
            return _services.ReadLoginXML(FileName);
        }
    }
}
